<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function getSun() {
        // arguments 动态参数只存在于函数里
        // 是伪数组
        let sun = 0;
        for (let i = 0; i < arguments.length; i++) {
          sun += arguments[i];
        }
        console.log(sun);
      }
      getSun(2, 3, 4);
      getSun(1, 2, 3, 4, 2, 2, 3, 4);
    </script>
  </body>
</html>
